Skip to content

Make site work with the Cloudflare OpenNext adapter #7383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Jan 2, 2025

This PR applies changes to make it so that the site can be deployed to Cloudflare workers using the open-next Cloudflare adapter

The app does seem to work as intended for the most part:
Screenshot 2025-01-02 at 19 46 00

Deployment URL: https://nodejs-website.web-experiments.workers.dev


Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Apr 25, 2025 11:22am

@ovflowd
Copy link
Member

ovflowd commented Feb 1, 2025

@dario-piotrowicz do we have updates here? 👀

@dario-piotrowicz
Copy link
Member Author

Hey @ovflowd 👋

Sorry for keeping the PR lingering, there are a few smaller issues we addressed in our adapter (that I need to reflect here), and also ISR should be coming soon (@vicb can provide more context)

Besides that I just need to rebase the PR, the only significant issue remaining should be filesystem access, but I wanted to clarify that with you, I'll drop you a message today to clarify things

(PS: I hope the PR is not bothering you 🙇, if you want I can close it and reopen it when we're ready?)

@ovflowd
Copy link
Member

ovflowd commented Feb 16, 2025

Sorry for keeping the PR lingering, there are a few smaller issues we addressed in our adapter (that I need to reflect here), and also ISR should be coming soon (@vicb can provide more context)

This is awesome news. Excited to hear from @vicb

Besides that I just need to rebase the PR, the only significant issue remaining should be filesystem access, but I wanted to clarify that with you, I'll drop you a message today to clarify things

I believe we sorted that out on Slack 🖖

(PS: I hope the PR is not bothering you 🙇, if you want I can close it and reopen it when we're ready?)

Not at all <3

@ovflowd
Copy link
Member

ovflowd commented Apr 25, 2025

[23:24:15.336] Running build in Portland, USA (West) – pdx1
[23:24:15.430] Cloning github.com/nodejs/nodejs.org (Branch: dario/opennextjs-cloudflare, Commit: 2782ec5)
[23:24:17.645] Cloning completed: 2.213s
[23:24:17.646] Running "[[ "$VERCEL_GIT_COMMIT_REF" =~ dependabot* || "$VERCEL_GIT_COMMIT_REF" =~ gh-readonly* ]]"
[23:24:20.095] Restored build cache from previous deployment (BZpxwWtQAKg5KVgr92WWADwJHuda)
[23:24:20.175] Running "vercel build"
[23:24:20.982] Vercel CLI 41.6.2
[23:24:21.181] WARN! Missing required `build` task in turbo.json. Skipping automatic setting assignment.
[23:24:22.849] Running "install" command: `npm install --omit=dev --include-workspace-root`...
[23:24:29.795] 
[23:24:29.795] > prepare
[23:24:29.796] > husky
[23:24:29.796] 
[23:24:29.864] 
[23:24:29.864] added 18 packages, removed 24 packages, changed 16 packages, and audited 647 packages in 7s
[23:24:29.865] 
[23:24:29.865] 203 packages are looking for funding
[23:24:29.865]   run `npm fund` for details
[23:24:29.866] 
[23:24:29.866] 2 moderate severity vulnerabilities
[23:24:29.866] 
[23:24:29.866] To address all issues (including breaking changes), run:
[23:24:29.866]   npm audit fix --force
[23:24:29.866] 
[23:24:29.866] Run `npm audit` for details.
[23:24:29.907] Detected Next.js version: 15.3.0
[23:24:29.907] Running "turbo build"
[23:24:29.940] Turborepo did not find the correct binary for your platform.
[23:24:29.940] We will attempt to install it now.
[23:24:30.640] Installation has succeeded.
[23:24:30.709] • Packages in scope: @node-core/website
[23:24:30.710] • Running build in 1 packages
[23:24:30.710] • Remote caching enabled
[23:24:31.025] @node-core/website-i18n:build: cache miss, executing b26bfad4ce8b49c0
[23:24:31.145] @node-core/website-i18n:build: 
[23:24:31.146] @node-core/website-i18n:build: > build
[23:24:31.146] @node-core/website-i18n:build: > tsc --declaration --emitDeclarationOnly
[23:24:31.146] @node-core/website-i18n:build: 
[23:24:32.423] @node-core/website:build: cache miss, executing 673e1b11a5cb79da
[23:24:32.544] @node-core/website:build: 
[23:24:32.544] @node-core/website:build: > prebuild
[23:24:32.544] @node-core/website:build: > npm run build-blog-data
[23:24:32.544] @node-core/website:build: 
[23:24:32.670] @node-core/website:build: 
[23:24:32.670] @node-core/website:build: > build-blog-data
[23:24:32.670] @node-core/website:build: > node ./scripts/blog-data/generate.mjs
[23:24:32.670] @node-core/website:build: 
[23:24:33.074] @node-core/website:build: 
[23:24:33.074] @node-core/website:build: > build
[23:24:33.074] @node-core/website:build: > cross-env NODE_NO_WARNINGS=1 next build
[23:24:33.074] @node-core/website:build: 
[23:24:33.704] @node-core/website:build:    ▲ Next.js 15.3.0
[23:24:33.705] @node-core/website:build:    - Experiments (use with caution):
[23:24:33.705] @node-core/website:build:      ✓ webpackBuildWorker
[23:24:33.705] @node-core/website:build:      ✓ parallelServerCompiles
[23:24:33.705] @node-core/website:build:      ✓ parallelServerBuildTraces
[23:24:33.705] @node-core/website:build: 
[23:24:33.750] @node-core/website:build:    Creating an optimized production build ...
[23:24:47.065] @node-core/website:build: Failed to compile.
[23:24:47.066] @node-core/website:build: 
[23:24:47.066] @node-core/website:build: next.fonts.ts
[23:24:47.066] @node-core/website:build: An error occurred in `next/font`.
[23:24:47.066] @node-core/website:build: 
[23:24:47.066] @node-core/website:build: Error: Cannot find module '@tailwindcss/oxide-linux-x64-gnu'
[23:24:47.066] @node-core/website:build: Require stack:
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/oxide/index.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-build/impl.js
[23:24:47.066] @node-core/website:build: - /vercel/path0/node_modules/next/dist/compiled/jest-worker/processChild.js
[23:24:47.066] @node-core/website:build:     at Function.<anonymous> (node:internal/modules/cjs/loader:1225:15)
[23:24:47.066] @node-core/website:build:     at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[23:24:47.066] @node-core/website:build:     at Function._load (node:internal/modules/cjs/loader:1055:27)
[23:24:47.067] @node-core/website:build:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[23:24:47.067] @node-core/website:build:     at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
[23:24:47.067] @node-core/website:build:     at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12)
[23:24:47.067] @node-core/website:build:     at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[23:24:47.067] @node-core/website:build:     at require (node:internal/modules/helpers:136:16)
[23:24:47.067] @node-core/website:build:     at Object.<anonymous> (/vercel/path0/node_modules/@tailwindcss/oxide/index.js:190:31)
[23:24:47.067] @node-core/website:build:     at Module._compile (node:internal/modules/cjs/loader:1554:14)
[23:24:47.067] @node-core/website:build: 
[23:24:47.067] @node-core/website:build: next.fonts.ts
[23:24:47.067] @node-core/website:build: An error occurred in `next/font`.
[23:24:47.067] @node-core/website:build: 
[23:24:47.067] @node-core/website:build: Error: Cannot find module '@tailwindcss/oxide-linux-x64-gnu'
[23:24:47.067] @node-core/website:build: Require stack:
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/oxide/index.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-build/impl.js
[23:24:47.067] @node-core/website:build: - /vercel/path0/node_modules/next/dist/compiled/jest-worker/processChild.js
[23:24:47.067] @node-core/website:build:     at Function.<anonymous> (node:internal/modules/cjs/loader:1225:15)
[23:24:47.067] @node-core/website:build:     at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[23:24:47.067] @node-core/website:build:     at Function._load (node:internal/modules/cjs/loader:1055:27)
[23:24:47.067] @node-core/website:build:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[23:24:47.067] @node-core/website:build:     at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
[23:24:47.067] @node-core/website:build:     at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12)
[23:24:47.067] @node-core/website:build:     at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[23:24:47.067] @node-core/website:build:     at require (node:internal/modules/helpers:136:16)
[23:24:47.067] @node-core/website:build:     at Object.<anonymous> (/vercel/path0/node_modules/@tailwindcss/oxide/index.js:190:31)
[23:24:47.067] @node-core/website:build:     at Module._compile (node:internal/modules/cjs/loader:1554:14)
[23:24:47.068] @node-core/website:build: 
[23:24:47.068] @node-core/website:build: ./components/Blog/BlogHeader/index.module.css
[23:24:47.068] @node-core/website:build: Error: Cannot find module '@tailwindcss/oxide-linux-x64-gnu'
[23:24:47.068] @node-core/website:build: Require stack:
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/oxide/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-build/impl.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/compiled/jest-worker/processChild.js
[23:24:47.068] @node-core/website:build:     at Function.<anonymous> (node:internal/modules/cjs/loader:1225:15)
[23:24:47.068] @node-core/website:build:     at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[23:24:47.068] @node-core/website:build:     at Function._load (node:internal/modules/cjs/loader:1055:27)
[23:24:47.068] @node-core/website:build:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[23:24:47.068] @node-core/website:build:     at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
[23:24:47.068] @node-core/website:build:     at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12)
[23:24:47.068] @node-core/website:build:     at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[23:24:47.068] @node-core/website:build:     at require (node:internal/modules/helpers:136:16)
[23:24:47.068] @node-core/website:build:     at Object.<anonymous> (/vercel/path0/node_modules/@tailwindcss/oxide/index.js:190:31)
[23:24:47.068] @node-core/website:build:     at Module._compile (node:internal/modules/cjs/loader:1554:14)
[23:24:47.068] @node-core/website:build: 
[23:24:47.068] @node-core/website:build: Import trace for requested module:
[23:24:47.068] @node-core/website:build: ./components/Blog/BlogHeader/index.module.css
[23:24:47.068] @node-core/website:build: ./components/Blog/BlogHeader/index.tsx
[23:24:47.068] @node-core/website:build: ./layouts/Blog.tsx
[23:24:47.068] @node-core/website:build: ./components/withLayout.tsx
[23:24:47.068] @node-core/website:build: ./app/[locale]/page.tsx
[23:24:47.068] @node-core/website:build: 
[23:24:47.068] @node-core/website:build: ./components/Blog/BlogPostCard/index.module.css
[23:24:47.068] @node-core/website:build: Error: Cannot find module '@tailwindcss/oxide-linux-x64-gnu'
[23:24:47.068] @node-core/website:build: Require stack:
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/oxide/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[23:24:47.068] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[23:24:47.069] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-build/impl.js
[23:24:47.069] @node-core/website:build: - /vercel/path0/node_modules/next/dist/compiled/jest-worker/processChild.js
[23:24:47.070] @node-core/website:build:     at Function.<anonymous> (node:internal/modules/cjs/loader:1225:15)
[23:24:47.070] @node-core/website:build:     at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[23:24:47.071] @node-core/website:build:     at Function._load (node:internal/modules/cjs/loader:1055:27)
[23:24:47.071] @node-core/website:build:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[23:24:47.071] @node-core/website:build:     at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
[23:24:47.071] @node-core/website:build:     at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12)
[23:24:47.071] @node-core/website:build:     at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[23:24:47.071] @node-core/website:build:     at require (node:internal/modules/helpers:136:16)
[23:24:47.071] @node-core/website:build:     at Object.<anonymous> (/vercel/path0/node_modules/@tailwindcss/oxide/index.js:190:31)
[23:24:47.071] @node-core/website:build:     at Module._compile (node:internal/modules/cjs/loader:1554:14)
[23:24:47.071] @node-core/website:build: 
[23:24:47.071] @node-core/website:build: Import trace for requested module:
[23:24:47.071] @node-core/website:build: ./components/Blog/BlogPostCard/index.module.css
[23:24:47.071] @node-core/website:build: ./components/Blog/BlogPostCard/index.tsx
[23:24:47.071] @node-core/website:build: ./components/withBlogCategories.tsx
[23:24:47.071] @node-core/website:build: ./layouts/Blog.tsx
[23:24:47.071] @node-core/website:build: ./components/withLayout.tsx
[23:24:47.071] @node-core/website:build: ./app/[locale]/page.tsx
[23:24:47.071] @node-core/website:build: 
[23:24:47.071] @node-core/website:build: ./components/Downloads/DownloadButton/index.module.css
[23:24:47.071] @node-core/website:build: Error: Cannot find module '@tailwindcss/oxide-linux-x64-gnu'
[23:24:47.071] @node-core/website:build: Require stack:
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/oxide/index.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/next/dist/build/webpack-build/impl.js
[23:24:47.071] @node-core/website:build: - /vercel/path0/node_modules/next/dist/compiled/jest-worker/processChild.js
[23:24:47.071] @node-core/website:build:     at Function.<anonymous> (node:internal/modules/cjs/loader:1225:15)
[23:24:47.071] @node-core/website:build:     at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[23:24:47.071] @node-core/website:build:     at Function._load (node:internal/modules/cjs/loader:1055:27)
[23:24:47.072] @node-core/website:build:     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[23:24:47.072] @node-core/website:build:     at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
[23:24:47.072] @node-core/website:build:     at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12)
[23:24:47.072] @node-core/website:build:     at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[23:24:47.072] @node-core/website:build:     at require (node:internal/modules/helpers:136:16)
[23:24:47.072] @node-core/website:build:     at Object.<anonymous> (/vercel/path0/node_modules/@tailwindcss/oxide/index.js:190:31)
[23:24:47.072] @node-core/website:build:     at Module._compile (node:internal/modules/cjs/loader:1554:14)
[23:24:47.072] @node-core/website:build: 
[23:24:47.072] @node-core/website:build: Import trace for requested module:
[23:24:47.072] @node-core/website:build: ./components/Downloads/DownloadButton/index.module.css
[23:24:47.072] @node-core/website:build: ./components/Downloads/DownloadButton/index.tsx
[23:24:47.072] @node-core/website:build: 
[23:24:47.072] @node-core/website:build: 
[23:24:47.072] @node-core/website:build: > Build failed because of webpack errors
[23:24:47.084] @node-core/website:build: npm error Lifecycle script `build` failed with error:
[23:24:47.085] @node-core/website:build: npm error code 1
[23:24:47.085] @node-core/website:build: npm error path /vercel/path0/apps/site
[23:24:47.085] @node-core/website:build: npm error workspace @node-core/website
[23:24:47.085] @node-core/website:build: npm error location /vercel/path0/apps/site
[23:24:47.085] @node-core/website:build: npm error command failed
[23:24:47.085] @node-core/website:build: npm error command sh -c cross-env NODE_NO_WARNINGS=1 next build
[23:24:47.090] @node-core/website:build: ERROR: command finished with error: command (/vercel/path0/apps/site) /node22/bin/npm run build exited (1)
[23:24:47.090] @node-core/website#build: command (/vercel/path0/apps/site) /node22/bin/npm run build exited (1)
[23:24:47.094] 
[23:24:47.094]   Tasks:    1 successful, 2 total
[23:24:47.094]  Cached:    0 cached, 2 total
[23:24:47.094]    Time:    16.434s 
[23:24:47.094] Summary:    /vercel/path0/.turbo/runs/2wBzjCBQQxxAxcjNy7CbDQzKVek.json
[23:24:47.094]  Failed:    @node-core/website#build
[23:24:47.094] 
[23:24:47.099]  ERROR  run failed: command  exited (1)
[23:24:47.112] Error: Command "turbo build" exited with 1
[23:24:47.843] 

"@flarelabs-net/wrangler-build-time-fs-assets-polyfilling": "^0.0.0"
},
"optionalDependencies": {
"@tailwindcss/oxide-linux-x64-gnu": "~4.1.4"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding this following tailwindlabs/tailwindcss#15806 (comment)

I'm not really sure what's going on here to be honest 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants